home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacHack 2000
/
MacHack 2000.toast
/
pc
/
The Hacks
/
Softshoe
/
Lisa's Mac Parts
/
Macintosh Memory
/
ApplicationZoneUser.cp
next >
Wrap
Text File
|
2000-06-23
|
980b
|
49 lines
// ApplicationZoneUser.cp
#ifndef ApplicationZoneUser_h
#include "ApplicationZoneUser.h"
#endif
#ifndef HeapZone_h
#include "HeapZone.h"
#endif
#ifndef Assert_h
#include "Assert.h"
#endif
ApplicationZoneUser::ApplicationZoneUser( uint32 moreMasters,
uint32 extraStackSpace )
{
static bool initialized = false;
static const uint32 mastersAdded( moreMasters );
static const uint32 stackSpaceAdded( extraStackSpace );
if ( initialized )
{
Assert( moreMasters <= mastersAdded );
Assert( extraStackSpace <= stackSpaceAdded );
return;
}
initialized = true;
if ( extraStackSpace > 0 )
SetApplLimit( GetApplLimit() - extraStackSpace );
if ( moreMasters > 0 )
{
Assert( moreMasters <= maxint16 );
HeapZone& heap( HeapZone::Application() );
uint16 oldIncrement = heap.moreMast;
if ( moreMasters > oldIncrement )
heap.moreMast = moreMasters;
MoreMasters();
heap.moreMast = oldIncrement;
}
MaxApplZone();
}